//
//  SHINavigationController.m
//  诗韵
//
//  Created by Song on 2017/12/25.
//  Copyright © 2017年 Song. All rights reserved.
//

#import "SHINavigationController.h"
#import "ShouyeViewController.h"
#import "shisheViewController.h"
#import "contactViewController.h"
#import "jishiViewController.h"

@interface SHINavigationController ()

@end

@implementation SHINavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    ShouyeViewController *shouye = [[ShouyeViewController alloc] init];
    contactViewController *contact = [[contactViewController alloc] init];
    shisheViewController *shishe = [[shisheViewController alloc] init];
    jishiViewController *jishi = [[jishiViewController alloc] init];
    
    [self addChildViewController:shouye];
    [self addChildViewController:contact];
    [self addChildViewController:shishe];
    [self addChildViewController:jishi];
    
    // navigationbar 背景图片
    [self.navigationBar setShadowImage:[UIImage new]]; // 去掉下划线
    [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"background_top"] forBarMetrics:UIBarMetricsDefault];
}

//-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
//    
//    if (self.childViewControllers.count > 0) {
//        
//        // 左上角返回按钮
//        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//        [button setImage:[UIImage imageNamed:@"navigationButtonReturn"] forState:UIControlStateNormal];
//        [button setImage:[UIImage imageNamed:@"navigationButtonReturnClick"] forState:UIControlStateHighlighted];
//        [button setTitle:@"返回" forState:UIControlStateNormal];
//        [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
//        [button setTitleColor:[UIColor redColor] forState:UIControlStateHighlighted];
//        [button sizeToFit];
//        
//        // 内容的内边距（按钮左移）
//        button.contentEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
//        
//        [button addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
//        viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
//        
//        // 隐藏tabbar
//        viewController.hidesBottomBarWhenPushed = YES;
//    }
//    
//    [super pushViewController:viewController animated:animated];
//}
//-(void)back {
//    [self popViewControllerAnimated:YES];
//}

@end
